package pl.edu.agh.gronoMining.frequentSubgraphFinder.graph;

import java.util.Set;

/**
 * represents node of graph
 */

public interface Node {
	
	/**
	 * @return id of node
	 */
	public int getId();

	/**
	 * @return label of node
	 */
	public int getLabel();

	/**
	 * @return type of node
	 */
	public int getType();

	/**
	 * sets id of node
	 * @param id new id of node
	 */
	public void setId(int id);

	/**
	 * sets label of node
	 * @param label new label of node 
	 */
	public void setLabel(int label);

	/**
	 * sets type of node
	 * @param type new type of node
	 */
	public void setType(int type);
	
	/**
	 * get all edges that contains this node
	 * @return all edges that contains this node
	 */
	public Set<Edge> getEdges();
	
	/**
	 * add edge to this node
	 * @param edge new edge
	 * @throws GraphException when node already contains this edge
	 */
	public void addEdge(Edge edge) throws GraphException ;
	
	/**
	 * adds node and edge between node and this node
	 * @param node node to add
	 * @param edgeLabel label of new edge
	 * @return object that represents new edge
	 * @throws GraphException when node or edge already exist
	 */
	public Edge addEdgeToNode(Node node, int edgeLabel) throws GraphException;
	
	/**
	 * gets edge that connect this node and node given as argument
	 * @param node
	 * @return
	 */
	public Edge getEdgeToNode(Node node);
	
	/**
	 * makes full copy of this node
	 * @param newId id of new node
	 * @return new node with all data of this node and id given as argument
	 */
	public Node copy(int newId);
	
	/**
	 * remove edge from node
	 * @param edge edge to remove
	 */
	public void removeEdge(Edge edge);
	
}
